{% extends "catalog.html" %}

{% block content %}
    <div class="product_name">
        <img src="{{ MEDIA_URL }}images/products/main/{{ p.image }}"
             alt="{{ p.name }}" />
    </div>
    <h1>{{ p.name }}</h1>
    Brand: <em>{{ p.brand }}</em>
    <br /><br />
    SKU: {{ p.sku }}
    <br />
    In category{{ categories.count|pluralize:"y, ies" }}:
    {% for c in categories %}
        <a href="{{ c.get_absolute_url }}">{{ c.name }}</a>
        {% if not forloop.last %}, {% endif %}
    {% endfor %}
    <br> <br>
    {% if p.sale_price %}
        Was: <del>$ {{ p.old_price }}</del>
        <br>
        Now: $ {{ p.price }}
    {% else %}
        Price: $ {{ p.price }}
    {% endif %}
    <br><br>
    <form action="" method="post" class="cart">{% csrf_token %}
        {{ form.as_p }}
        <br>
        <input type="submit" value="Add To Cart" name="submit" alt="Add To Cart" />
    </form>
    <div class="cb"></div>
    <br> <br>
    <div class="cb"><br><br></div>
    <h3>Product Description</h3>
        {{ p.description }}
{% endblock content %}